<?php
require_once("checklogin.php");
require_once("classQuanTriTin.php");
$qt = new quantritin;
$idWard=$_GET['idWard']; settype($idWard,"int");
if (isset($_POST['btnUpdate'])==true) {
	$qt ->UpdateWard($idWard);
	header("location:main.php?p=ward_list");
}
?>
<?php
	$ward = $qt->DetailWard($idWard);	
	$row_ward = mysql_fetch_assoc($ward);
?>
<?php $district = $qt ->District(-1) ; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>LOẠI TIN CHỈNH</title>
<link href="../css/from_label.css" rel="stylesheet" type="text/css" />
</head>

<body>
<form id="form1" name="form1" method="post" action="">
 <table id="themtheloai" width="500" border="0" align="center" cellpadding="4" cellspacing="0">
    <tr> <td colspan="2" align="center">
    <div id="from_label_left"></div>
  <div id="from_label_right"></div>
  <div id="from_label_center"><span id="header">CHỈNH PHƯỜNG</span></div>
  </div></td> </tr>
    <tr> <td width="194" align="right">Tên loại tin</td>
      <td width="298"><input type="text" name="name" id="Ten" value="<?=$row_ward['name'];?>" /></td>
    </tr>
    <tr> <td width="194" align="right">Thứ tự</td>
      <td width="298"><input type="text" name="ThuTu" id="ThuTu" value="<?=$row_ward['ThuTu'];?>" /></td>
    </tr>
    <tr> <td width="194" align="right">Ẩn hiện</td>
         <td width="298"> <input type="radio" name="AnHien" id="an" value="0"  <? echo ($row_ward['AnHien']==0)? "checked=checked":""; ?> />Ẩn
             <input type="radio" name="AnHien" id="hien" value="1" <? echo ($row_ward['AnHien']==1)? "checked=checked":""; ?>/>Hiện
   </td>
    </tr>
    <tr> <td width="194" align="right">Thể loại</td>
         <td width="298"> 
         
      <select name="idDistrict" id="lang">
			<?php 
                while ($row_district=mysql_fetch_assoc($district)){ 
                $idDistrict = $row_district['idDistrict'];
                $name = $row_district['name'];
                $s = "";
                if ($idDistrict==$row_ward['idDistrict']) $s = "selected='selected'";
                echo "<option value=$idDistrict $s > $name </option>";
                }
            ?>

  			</select>
 </td>
    </tr>
    <tr>
      <td colspan="2" align="center">
	<input type="reset" name="btnxoa" id="btnxoa" value=" Xoá " />&nbsp;
	<input type="submit" name="btnUpdate" id="btnUpdate" value="  OK  " />
	</td>
    </tr>
  </table></form>

</body>
</html>
